package com.example.nacosProvider.controller;

import com.example.nacosProvider.entity.Customer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/helloProvider")
public class NacosProviderController {

    private static final Logger LOGGER = LoggerFactory.getLogger(NacosProviderController.class);

    @GetMapping
    @ResponseBody
    public String hello(@RequestParam("name") String name) {
        return "Hello Nacos Discovery " + name;
    }

    @PostMapping
    public String insertInfo(@RequestBody Customer customer) {
        LOGGER.info("接收到的参数是：{}", customer);
        return customer.toString();
    }
}
